import React from 'react'
import ReactEcharts from 'echarts-for-react'
import { registerMap } from 'echarts'
import getOption from './mapOpt'
import { mapJson } from './mapJson'

export class Homepage extends React.Component {
    public state = {}

    public constructor(props: any) {
        super(props)
        registerMap('china', mapJson as any)
    }

    public render() {
        return (
            <div className="map-echarts-wrap" style={{ width: '100%', height: '100%' }}>
                <ReactEcharts
                    option={getOption()}
                    notMerge={true}
                    lazyUpdate={true}
                    // onEvents={}
                    style={{ width: '100%', height: '100%' }}
                />
            </div>
        )
    }
}
